<?php 
header("content-type:text/html;charset=utf-8");
$dsn="mysql:host=127.0.0.1;dbname=zice;charset=utf8";
$db=new PDO($dsn,'root','root');
$name=isset($_POST['name'])?$_POST['name']:'';
$pwd=isset($_POST['pwd'])?$_POST['pwd']:'';
$sql="select * from user where name='$name' and pwd='$pwd'";
$res=$db->query($sql);
if($res){
	echo "<script>alert('登陆成功');location.href='show.php';</script>";
}else{
	echo "<script>alert('登陆失败');</script>";
}








 ?>